widget: Check the widget has an allocation in gtk_widget_draw()
authorBenjamin Otte <otte@redhat.com>
Wed, 15 Sep 2010 01:20:59 +0000 (03:20 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 26 Sep 2010 13:11:43 +0000 (15:11 +0200)
Following the mailing list discussion, require that the widget does not
have a pending size_allocate when calling the draw function.

http://mail.gnome.org/archives/gtk-devel-list/2010-September/msg00214.html
and the associated thread explain this in more detail.

gtk/gtkwidget.c

index e397016692d53da5abb55c72b05f6ff62f5c5832..096740ca7b87416ca372e839c579e997cac7a7fa 100644 (file)
@@ -5150,6 +5150,7 @@ gtk_widget_draw (GtkWidget *widget,
   GdkEventExpose *tmp_event;
 
   g_return_if_fail (GTK_IS_WIDGET (widget));
+  g_return_if_fail (!GTK_WIDGET_ALLOC_NEEDED (widget));
   g_return_if_fail (cr != NULL);
 
   cairo_save (cr);